package fcl.mylife;

import java.sql.Date;
import java.text.SimpleDateFormat;

public class Move{

	private Stop start = null;
	private Stop end = null;
	
	private double distance;
	private int vehicletype;
	private int startlocationtype;
	private int endlocationtype;
	private long starttime;
	private long endtime;
	private long duration = (long) 0.0;
	
	
	private String tripId;

	public Move(Stop s, Stop e){
		this.start = s;
		this.end = e;
	}
	
	public Stop getStart(){
		return this.start;
	}
	
	public Stop getEnd(){
		return this.end;
	}
	
	
	public void setDis(double dis){
		this.distance = dis;
	}
	
	public double getDis(){
		return this.distance;
	}
	
	public void setVehicle(int type){
		this.vehicletype = type;
	}
	
	public int getVehicle(){
		return this.vehicletype;
	}
	
	public void setstartLocType(int type){
		this.startlocationtype = type;
		
		if(start!=null){
			start.setLocType(type);
		}
	}
	
	public int getstartLocType(){
		return this.startlocationtype;
	}
	
	public void setendLocType(int type){
		this.endlocationtype = type;
		
		if(end != null){
			end.setLocType(type);
		}
	}
	
	public int getendLocType(){
		return this.endlocationtype;
	}

	public void setStartTime(long start) {
		// TODO Auto-generated method stub
		this.starttime = start;
	}

	public void setEndTime(long end) {
		// TODO Auto-generated method stub
		this.endtime = end;
	}

	public void setTiemType(String string) {
		// TODO Auto-generated method stub
		
	}

	public void setduration(long dur) {
		// TODO Auto-generated method stub
		this.duration = dur;
	}
	
	
	public long getStartTimeInLong(){
		
		return this.starttime;
	}
	
	
   public long getEndTimeInLong(){
	   
		return this.endtime;
	}
   
   public long getDuration(){
	   
	   return this.duration;
   }
   
   public Date getStartTime(){
	   
	   return this.getDate(this.starttime); 
   }
   
   public Date getEndTime(){
	   return this.getDate(this.endtime);
   }
   
  

   public Date getDate(long mmilli){
	   
	   SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMM dd HH:mm");
 		 
  		Date resultdate =  new Date(mmilli);
  		return resultdate;
   }

   public String getDateString(long mmilli) {
   		
   		SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMM dd HH:mm");
   		 
   		Date resultdate =  new Date(mmilli);
   			
   		String milli = sdf.format(resultdate);  
   		
   		return (milli);

   	}

   public int getHour(long mmilli) {
   	
   	 
   	Date resultdate =  new Date(mmilli);

   	int hour = resultdate.getHours();
   	
   	return hour;

   }


 
   
	
}
